<?php

class GHeader extends GHeaderParent {

    function __construct($tilulo) {
        parent::__construct($tilulo);
    }

    /**
     * Exibir o cabeçalho da página completo
     *
     * @param boolean $isIframe default: false
     * @param string $currentMenu default: 'index'
     * @param string $breadcrumb default: ''
     */
    function show($isIframe = false, $currentMenu = 'home', $breadcrumb = '') {
        parent::show();
        $show = '';
        if (!$isIframe) {
            $show .= '<body>';
            $show .= '<style type="text/css">
                          body { padding-top: 60px; padding-bottom: 40px; }
                          .sidebar-nav { padding: 9px 0; }
                      </style>';
            $show .= '<div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container-fluid">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="#">' . SYS_TITLE . '</a>
                    <div class="btn-group pull-right">
                        <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="icon-user"></i> Username
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Profile</a></li>
                            <li class="divider"></li>
                            <li><a href="#">Sign Out</a></li>
                        </ul>
                    </div>';
            $show .= $this->getMenu($currentMenu);
            $show .= '</div>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">';





            $show .= $this->getBreacrumb($breadcrumb);
        } else {
            $show .= '<body style="background:none;min-width: 0;min-height: 0;">';
            $show .= '<div class="__corpoFrame" style="padding: 5px;">';
        }
        echo $show;
    }

    function getMenu($current) {
        $html = '<ul id="menu">';

        $home = ($current == 'home') ? 'active' : '';
        $sobre = ($current == 'sobre') ? 'active' : '';
        $contato = ($current == 'contato') ? 'active' : '';

        $html = '<div class="nav-collapse">';
        $html .= '<ul class="nav">';
        $html .= '<li class="' . $home . '"><a href="' . URL_SYS . 'index.php">Home</a></li>';
        $html .= '<li class="' . $sobre . '"><a href="' . URL_SYS . 'sobre.php">Sobre</a></li>';
        $html .= '<li class="' . $contato . '"><a href="' . URL_SYS . 'contato.php">Contato</a></li>';
        $html .= '</ul>';
        $html .= '</div><!--/.nav-collapse -->';


        $html .= '</ul>';
        return $html;
    }

    function getBreacrumb() {
        $html = '<div id="breadcrumb">';
        //TODO: Implementar os breadcrumbs de acordo com o sistema
        $html .= '</div>';
        return $html;
    }

}
?>

